package com.michael.demo.springcloud.alibaba.seata.storage.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.michael.demo.springcloud.alibaba.seata.storage.entity.Storage;
import com.michael.demo.springcloud.alibaba.seata.storage.mapper.StorageMapper;
import com.michael.demo.springcloud.alibaba.seata.storage.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 类功能描述:
 * <pre>
 *   xxxx
 * </pre>
 *
 * @author Michael
 * @version 1.0
 * @date 2021/04/01 16:44
 */
@Service
public class StorageServiceImpl extends ServiceImpl<StorageMapper, Storage> implements StorageService {

    @Autowired
    private StorageMapper storageMapper;

    @Override
    public boolean deductByCode(String code, Integer count) {
        return storageMapper.deductByCode(code, count) == 1;
    }
}
